<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>上官婉儿</title>
    <link href="/css/bootstrap.min.css" rel="stylesheet">
    <link href="/font-awesome/css/font-awesome.css" rel="stylesheet">
    <link href="/css/animate.css" rel="stylesheet">
    <link href="/css/style.css" rel="stylesheet">
    <link href="/css/plugins/iCheck/custom.css" rel="stylesheet">
</head>

<body class="gray-bg text-muted">
<div class="container">
    <div class="row">
        <div class="col-lg-4 col-md-offset-4">
            <div class="well well-lg" style="margin-top: 30%;background-color: #fff">
                <h1 class="text-center">登录</h1>
                <form class="m-t" id="dataForm">
                    <div class="form-group">
                        <input type="text" name="loginName" class="form-control" placeholder="用户名">
                    </div>
                    <div class="form-group">
                        <input type="password" name="password" class="form-control" placeholder="密码">
                    </div>
                    <div class="form-group">
                        <label style="margin-bottom: 0px;"> <input type="checkbox" class="i-checks"> 记住密码 </label>
                    </div>
                </form>
                <button onclick="ajaxLogin()" class="btn btn-primary block full-width m-b">登录</button>
            </div>
        </div>
    </div>
</div>

<!-- Mainly scripts -->
<script src="/js/jquery-3.1.1.min.js"></script>
<script src="/js/bootstrap.min.js"></script>
<script src="/js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<!-- Custom and plugin javascript -->
<script src="/js/inspinia.js"></script>
<script src="/js/plugins/pace/pace.min.js"></script>
<!-- iCheck -->
<script src="/js/plugins/iCheck/icheck.min.js"></script>
<script src="/component/layer/layer.js"></script>
<script src="/custom/js/common/bzxgc-utils.js"></script>
<script type="text/javascript">
    var ajaxLoginUrl = "/user/ajax/login";
    var indexUrl = "/"
    $(function () {
        $('.i-checks').iCheck({
            checkboxClass: 'icheckbox_square-green',
            radioClass: 'iradio_square-green',
        });
    })
    function ajaxLogin() {
        console.log($("#dataForm").serialize());
        ajaxPost(ajaxLoginUrl, $("#dataForm").serialize(), function (result) {
            if (result.status == 200) {
                layer.msg(result.msg, {time: 1000}, function () {
                    location.href = indexUrl;
                });
            } else {
                layer.alert(result.msg, {icon: 5});
            }
        })
    }
</script>
</body>
</html>
